package pokpok.domaine;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable
public class Tournoi implements Identifiable {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key id;

	@Persistent
	private Date date;
	@Persistent
	private Integer buyin;
	@Persistent
	private Integer recave;
	@Persistent
	private Integer addon;
	@Persistent
	private Integer nbJoueurs;
	@Persistent
	private Integer saison;

	public Tournoi(Date date, Integer buyin, Integer recave, Integer addon,
			Integer nbJoueurs, Integer saison) {
		super();
		this.date = date;
		this.buyin = buyin;
		this.recave = recave;
		this.addon = addon;
		this.nbJoueurs = nbJoueurs;
		this.saison = saison;
	}

	public Key getId() {
		return id;
	}

	public Date getDate() {
		return date;
	}

	public Integer getBuyin() {
		return buyin;
	}

	public Integer getRecave() {
		return recave;
	}

	public Integer getAddon() {
		return addon;
	}

	public Integer getNbJoueurs() {
		return nbJoueurs;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public void setBuyin(Integer buyin) {
		this.buyin = buyin;
	}

	public void setRecave(Integer recave) {
		this.recave = recave;
	}

	public void setAddon(Integer addon) {
		this.addon = addon;
	}

	public void setNbJoueurs(Integer nbJoueurs) {
		this.nbJoueurs = nbJoueurs;
	}

	public String getKeyString() {
		return KeyFactory.keyToString(id);
	}

	public Integer getSaison() {
		return saison;
	}

	public void setSaison(Integer saison) {
		this.saison = saison;
	}

}
